#ifndef RECORDVIDEOTHREAD_H
#define RECORDVIDEOTHREAD_H

#include <QtCore/QThread>
#include <QtCore/QQueue>
#include <QtCore/QByteArray>

class QFile;
class IpcClient;
class Video;

class RecordVideoThread : public QThread
{
	Q_OBJECT
public:
	explicit RecordVideoThread(Video *video, IpcClient *client, QObject *parent = 0);

	void run();

public slots:
	void setOutputFileName(const QString &fileName);
	void flushQueueToDisk();

private slots:
	void onNewFrame();

private:
	QQueue<QByteArray> mFrameQueue;
	QFile *mOutputFile;
	Video *mVideo;
	IpcClient *mIpcClient;
};

#endif
